home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / SASC_6.0_Disk_7.adf / Source_And_Examples / extras / Memlib / example.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-30  |  417 b   |  20 lines

  1. #include <exec/memory.h>
  2. #include <proto/exec.h>
  3.  
  4. #include "memwatch.h" /* To enable memlib, you must #define MWDEBUG to 1 */
  5.  
  6. int main(void)
  7. {
  8.    char *a;
  9.  
  10.    a = AllocMem(20, 0);  /* Note that we never free this memory */
  11.  
  12.    a = AllocMem(10, 0);
  13.  
  14.    FreeMem(a, 9);  /* Note that we free an incorrect length here */
  15.  
  16.    MWReport("At end of main()", MWR_FULL);  /* Generate a memory usage report */
  17.  
  18.    return(0);
  19. }
  20.